<include file="Public/header"/>
<div class="wrapper m-t">
    <div class="ibox float-e-margins">
        <div class="ibox-title">
            <a class="h3 font-bold">订单列表【待确认】</a>
        </div>
        <div class="ibox-content">

            <table class="table table-striped b-t b-light text-sm table-bordered">
                <thead>
                <tr >
                    <th width="10 "><input type="checkbox"></th>
                    <th>ID</th>
                    <th>订单号</th>
                    <th>姓名</th>
                    <th>区域</th>
                    <th>经销商</th>
                    <th>电话</th>
                    <th>制单人</th>
                    <th>客户状态</th>
                    <th>审单人</th>
                    <th>财务</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <volist name="_list" id="vo" key="k">
                    <tr>
                        <td><input type="checkbox" name="post[]" value="{$vo.id}"></td>
                        <td>{$vo.rid}</td>
                        <td>{$vo.order_number}</td>
                        <td>{$vo.username}</td>
                        <td>{$vo.area_name}</td>
                        <td>{$vo.company_name}</td>
                        <td>{$vo.mobile_phone}</td>
                         <td>{$vo.eecupeople}</td>
                        <td>
                            <if condition="$vo.cid eq 1">
                                 <span class="text-success">客服已确认</span>
                                <elseif condition="$vo.cid eq 0"/>
                                 <i class="text-danger">等待客户确认</i>
                            </if>
                        </td>
                        <td><if condition="$vo.is_audit eq 1"><span class="text-success">已审核</span><else/><i class="text-danger">未审核</i></if></td>
                        <td><if condition="$vo.is_finance eq 1"><span class="text-success">已审核</span><else/><i class="text-danger">未审核</i></if></td>
                        <td>
                            <a href="{:U('Orders/underwayOrderDetail?rid='.$vo['rid'])}" class="text-info" >详情</a>&nbsp;|&nbsp;
                            <a href="{:U('Orders/orderUpdate?rid='.$vo['rid'])}" class="text-info" >修改</a>&nbsp;|&nbsp;
                            <a href="{:U('Orders/startProduction?rid='.$vo['rid'])}" class="text-info confirms ajax-get" >开始生产</a>&nbsp;|&nbsp;
                            <if condition="$Think.session.tc.group_id eq 8">
                                <a onclick="caiwu({$vo.rid})">财务审核</a>&nbsp;|&nbsp;
                            </if>
                            <if condition="$Think.session.tc.group_id eq 9">
                                <a  onclick="dingdan({$vo.rid})">订单审核</a>&nbsp;|&nbsp;
                            </if>
                        </td>
                    </tr>
                </volist>
                </tbody>
            </table>
            <div>{$_page}</div>
        </div>
    </div>
</div>
<include file="Public/footer"/>
<script>
   function caiwu(rid){
       layer.prompt({title: '进行财务审核',value:'填写备注信息',offset: '100px'},
               function(val){
                   $.post("{:U('OrderSet/financePass')}",{rid:rid,remark:val,types:1},function(data){
                       if(data==200){
                           layer.alert('审核成功',{offset: '100px'},function(){
                               location.reload();
                           });
                       }else if(data==102){
                           layer.alert('请不要重复审核',{offset: '100px'});
                       }else if(data==101){
                           layer.alert('审核失败',{offset: '100px'});
                       }
                   })
               });
   }
//订单审核
   function dingdan(rid){
       layer.prompt({title: '进行订单审核',value:'填写备注信息',offset: '100px'},
               function(val){
                   $.post("{:U('OrderSet/financePass')}",{rid:rid,remark:val,types:2},function(data){
                       if(data==200){
                           layer.alert('审核成功',{offset: '100px'},function(){
                               location.reload();
                           });
                       }else if(data==102){
                           layer.alert('请不要重复审核',{offset: '100px'});
                       }else if(data==101){
                           layer.alert('审核失败',{offset: '100px'});
                       }
                   })
               });
   }


</script>